require("../../../common/manifest.js"), require("../../../common/vendor.js"), global.webpackJsonpMpvue([ 3 ], {
    EOGl: function(t, a) {},
    F3y6: function(t, a, e) {
        var i = e("P1u1"), s = e("HxQs"), n = e("ybqe")(i.a, s.a, function(t) {
            e("EOGl");
        }, null, null);
        a.a = n.exports;
    },
    HxQs: function(t, a, e) {
        var i = {
            render: function() {
                var t = this, a = t.$createElement, e = t._self._c || a;
                return e("div", [ e("div", {
                    directives: [ {
                        name: "show",
                        rawName: "v-show",
                        value: t.isConnected,
                        expression: "isConnected"
                    } ]
                }, [ e("div", {
                    staticClass: "result-bg"
                }, [ t.isSearch ? e("div", {
                    staticClass: "input-box result-input",
                    attrs: {
                        eventid: "1"
                    },
                    on: {
                        click: t.goSearch
                    }
                }, [ e("img", {
                    staticClass: "search-icon",
                    attrs: {
                        src: "/static/images/search.png"
                    }
                }), t._v(" "), e("input", {
                    directives: [ {
                        name: "model",
                        rawName: "v-model",
                        value: t.inputVal,
                        expression: "inputVal"
                    } ],
                    staticClass: "main-input",
                    attrs: {
                        type: "text",
                        placeholder: t.placeholder,
                        eventid: "0"
                    },
                    domProps: {
                        value: t.inputVal
                    },
                    on: {
                        confirm: t.search,
                        input: function(a) {
                            a.target.composing || (t.inputVal = a.target.value);
                        }
                    }
                }) ]) : t._e(), t._v(" "), e("div", {
                    staticClass: "wallpaper-box"
                }, t._l(t.wallpaperArr, function(a, i) {
                    return e("div", {
                        staticClass: "wallpaper-container"
                    }, [ e("img", {
                        staticClass: "wallpaper",
                        attrs: {
                            src: a.preview,
                            mode: t.mode,
                            eventid: "2_" + i
                        },
                        on: {
                            click: function(a) {
                                t.goDetails(i);
                            }
                        }
                    }) ]);
                })) ]) ]), t._v(" "), e("img", {
                    directives: [ {
                        name: "show",
                        rawName: "v-show",
                        value: t.isHome,
                        expression: "isHome"
                    } ],
                    staticClass: "home-btn",
                    attrs: {
                        src: "/static/images/home.png",
                        eventid: "3"
                    },
                    on: {
                        click: function(a) {
                            t.goMain();
                        }
                    }
                }), t._v(" "), !t.isConnected && t.isEnter ? e("div", {
                    staticClass: "network-remind"
                }, [ e("img", {
                    staticClass: "remind-icon",
                    attrs: {
                        src: "/static/images/network-remind.png"
                    }
                }), t._v(" "), e("p", [ t._v("网络开小差了~ ") ]) ], 1) : t._e(), t._v(" "), t.isConnected && t.isData && 0 === t.wallpaperArr.length ? e("div", {
                    staticClass: "network-remind"
                }, [ e("img", {
                    staticClass: "remind-icon",
                    attrs: {
                        src: "/static/images/content-remind.png"
                    }
                }), t._v(" "), e("p", [ t._v("暂无相关内容哦~") ]) ], 1) : t._e() ]);
            },
            staticRenderFns: []
        };
        a.a = i;
    },
    P1u1: function(t, a, e) {
        (function(t) {
            var i = e("lHA8"), s = e.n(i), n = e("Gu7T"), r = e.n(n);
            a.a = {
                data: function() {
                    return {
                        mode: "aspectFill",
                        isSearch: !1,
                        placeholder: "搜索你想要的壁纸类别",
                        wallpaperArr: [],
                        historyArr: [],
                        inputVal: "",
                        key: "",
                        cateId: "",
                        cateName: "",
                        page: 0,
                        isMax: !1,
                        isConnected: !0,
                        isData: !1,
                        isEnter: !1,
                        isHome: !1
                    };
                },
                onLoad: function(a) {
                    var e = null;
                    if (wx.createInterstitialAd && ((e = wx.createInterstitialAd({
                        adUnitId: "adunit-13934bc1d3a77a93"
                    })).onLoad(function() {}), e.onError(function(t) {}), e.onClose(function() {})), 
                    e && e.show().catch(function(t) {
                        console.error(t);
                    }), t.mpvue.setNavigationBarTitle({
                        title: "搜索"
                    }), this.setData(), this.isEnter = !0, this.isHome = !1, a.channel && (this.isHome = !0), 
                    "search" === a.tag) return this.isSearch = !0, this.key = this.inputVal = a.key, 
                    this.getSearchList(), void this.getHistory();
                    this.cateId = a.id, this.cateName = a.name, t.mpvue.setNavigationBarTitle({
                        title: this.cateName
                    }), this.getList();
                },
                onShow: function() {
                    2 === this.globalData.scene && (this.globalData.isScene = !0), this.globalData.scene = 1;
                },
                onHide: function() {
                    this.globalData.scene = 2;
                },
                onReachBottom: function() {
                    this.isSearch ? this.getSearchList() : this.getList();
                },
                onShareAppMessage: function() {
                    var t = this.globalData.shareArr, a = Math.floor(Math.random() * t.length);
                    return this.isSearch ? {
                        title: t[a],
                        path: "/pages/main/result/main?tag=search&key=" + this.key + "&channel=result"
                    } : {
                        title: t[a],
                        path: "/pages/main/result/main?tag=sort&id=" + this.cateId + "&name=" + this.cateName + "&channel=result"
                    };
                },
                mounted: function() {
                    var a = this;
                    t.mpvue.onNetworkStatusChange(function(t) {
                        a.isConnected = t.isConnected;
                    });
                },
                methods: {
                    setData: function() {
                        this.wallpaperArr = [], this.page = 0, this.isSearch = this.isMax = this.isData = !1, 
                        this.cateId = "";
                    },
                    goMain: function() {
                        t.mpvue.reLaunch({
                            url: "/pages/main/index/main"
                        });
                    },
                    goDetails: function(a) {
                        var e = void 0;
                        e = this.isSearch ? "/pages/main/details/main?tag=search&index=" + a + "&key=" + this.key + "&page=" + this.page : "/pages/main/details/main?tag=result&index=" + a + "&cateId=" + this.cateId + "&page=" + this.page, 
                        t.mpvue.setStorage({
                            key: "wallpaperArr",
                            data: this.wallpaperArr,
                            success: function(a) {
                                t.mpvue.navigateTo({
                                    url: e
                                });
                            }
                        });
                    },
                    getHistory: function() {
                        var a = this;
                        t.mpvue.getStorage({
                            key: "historyWord",
                            success: function(t) {
                                null !== t.data && (a.historyArr = t.data);
                            }
                        });
                    },
                    addHistory: function() {
                        this.historyArr.length < 8 ? (this.historyArr = [].concat(this.inputVal).concat(this.historyArr), 
                        this.historyArr = [].concat(r()(new s.a(this.historyArr)))) : (this.historyArr.pop(), 
                        this.historyArr = [].concat(this.inputVal).concat(this.historyArr), this.historyArr = [].concat(r()(new s.a(this.historyArr)))), 
                        t.mpvue.setStorage({
                            key: "historyWord",
                            data: this.historyArr
                        });
                    },
                    search: function(a) {
                        this.inputVal && "" !== this.inputVal.replace(/(^\s*)|(\s*$)/g, "") ? (this.setData(), 
                        this.key = this.inputVal, this.isSearch = !0, this.getSearchList()) : t.mpvue.showToast({
                            title: "你还没写东西呦~",
                            icon: "none"
                        });
                    },
                    getList: function() {
                        var a = this;
                        this.page++, this.isMax || t.mpvue.request({
                            url: "https://news.moxiu.com/applets/wallpaper/content",
                            method: "GET",
                            dataType: "json",
                            data: {
                                cateId: this.cateId,
                                page: this.page
                            },
                            header: {
                                "content-type": "application/json"
                            },
                            success: function(t) {
                                a.wallpaperArr = a.wallpaperArr.concat(t.data.data.list), a.page >= t.data.data.meta.pages && (a.isMax = !0);
                            },
                            fail: function(a) {
                                t.mpvue.showToast({
                                    title: "网络异常，请稍后再试",
                                    icon: "none"
                                });
                            }
                        });
                    },
                    getSearchList: function() {
                        var a = this;
                        this.page++, this.isMax || (1 === this.page && this.addHistory(), t.mpvue.request({
                            url: "https://news.moxiu.com/applets/wallpaper/search?q=" + this.key + "&page=" + this.page,
                            method: "POST",
                            dataType: "json",
                            header: {
                                "content-type": "application/json"
                            },
                            success: function(t) {
                                a.wallpaperArr = a.wallpaperArr.concat(t.data.data.list), a.isSearch = !0, a.isData = !0, 
                                a.page >= t.data.data.meta.pages && (a.isMax = !0);
                            },
                            fail: function(a) {
                                t.mpvue.showToast({
                                    title: "网络异常，请稍后再试",
                                    icon: "none"
                                });
                            }
                        }));
                    }
                }
            };
        }).call(a, e("DuR2"));
    },
    kUjJ: function(t, a, e) {
        Object.defineProperty(a, "__esModule", {
            value: !0
        });
        var i = e("5nAL"), s = e.n(i), n = e("F3y6");
        new s.a(n.a).$mount();
    }
}, [ "kUjJ" ]);